//mongoose文档模型设置文件



const { Schema } = require('mongoose')
const mongoose = require('mongoose')


class MySchema {
    constructor(){}
    static staticDataSchema = new Schema({
        page: String,
        path: String,
        footer: Number
    })
    static documentSchema = new Schema({
        title: String,
        content: String,
        topic: String,
        chapter: String,
        image: String,
        id: String,
        classify: String,
        to: String,
        isHot: Boolean
    })
    static topViewSchema = new Schema({
        title: String,
        image: String,
        search: Boolean
    })
    static yiriDocSchema = new Schema({
        subject: String,
        brief: String,
        docPage: String,
        content: String,
        prescription: String,
        id: String
    })
    static weChatDocumentSchema = new Schema({
        name: String,
        coverimg: String,
        content: String,
        to: String,
        id: String,
        date: String
    })

}

const YiriDoc = mongoose.model('YiriDocs', MySchema.yiriDocSchema)
const Static_Data = mongoose.model('Static_datas', MySchema.staticDataSchema)
const Document = mongoose.model('Documents', MySchema.documentSchema)

const top_view = mongoose.model('top_views', MySchema.topViewSchema)
const WeChat_Document = mongoose.model('WeChat_Documents', MySchema.weChatDocumentSchema)

module.exports = {
    Static_Data,
    Document,
    top_view,
    YiriDoc,
    WeChat_Document
}